/*
 * thread.h
 *
 *  Created on: 2012-8-25
 *      Author: dell
 */

#ifndef THREAD_H_
#define THREAD_H_
#include "../types.h"
#ifdef __cplusplus
extern "C"
{
#endif

#ifdef __WIN32__
typedef u32 (THREAD_API *thread_func_t)(lpvoid);
typedef i32 thread_pid;
typedef u32 thread_ret_t;
#elif linux
typedef lpvoid (*thread_func_t)(lpvoid);
typedef pthread_t thread_pid;
typedef lpvoid thread_ret_t;
#endif




typedef struct thread_t_
{
lpvoid sec;
i32 s_size;
thread_pid pid;
thread_func_t func;
u8 run_now;
u32 addr;
lpvoid params;
}thread_t;

u32 MCF_API begin_thread(thread_t *thread);
u32 MCF_API end_thread(thread_t *thread);
#ifdef __cplusplus
}
#endif

#endif /* THREAD_H_ */
